﻿<navigation:Page x:Class="DC_RackSLDE.vwtblAttrApplication" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
                 
           xmlns:input="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input"
           xmlns:dataControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
           xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
           xmlns:dataFormToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit" 
           xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
           xmlns:domain="clr-namespace:DC_RackSLDE"
         
           d:DesignWidth="640" d:DesignHeight="480"
           Title="Network Attributes">

    <Grid x:Name="LayoutRoot">


        <!-- Get the data definitions up front -->
        <!-- Edit Query Name -->
        <!-- defined over in the DomainService (RIA implementation) on the web side -->
        <!-- **************************** -->
        <riaControls:DomainDataSource x:Name="dds"             
                                              AutoLoad="True"            
                                              QueryName="GetTblAttrApplications"   
                                              LoadSize="20"
                                              LoadingData="dds_LoadingData"
                                              SubmittedChanges="dds_SubmittedChanges"
                                              >

            <riaControls:DomainDataSource.DomainContext>
                <domain:tblAttrApplication_DCRackDomainContext/>
            </riaControls:DomainDataSource.DomainContext>

            <!-- edit field name for group descriptor -->
            <!-- **************************** -->
            <riaControls:DomainDataSource.GroupDescriptors>
                <riaControls:GroupDescriptor PropertyPath="appName" />
            </riaControls:DomainDataSource.GroupDescriptors>

            <!-- edit propertypath name for filter descriptor -->
            <!-- **************************** -->
            <riaControls:DomainDataSource.FilterDescriptors>
                <riaControls:FilterDescriptor PropertyPath="appName"
                                               Operator="StartsWith" Value="{Binding ElementName=tableFilterBox, Path=Text}" />
            </riaControls:DomainDataSource.FilterDescriptors>
        </riaControls:DomainDataSource>

        <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}" Margin="0,0,0,-33">

            <!-- Busy Indicator -->
            <controlsToolkit:BusyIndicator 
            IsBusy="{Binding ElementName=dds, Path=IsBusy}"   
            >


                <!-- Content stack panel -->
                <!-- Comment start and stop of all of the stack panels -->
                <StackPanel x:Name="ContentStackPanel" 
                        Height="480" Width="640">

                    <!-- datacontrols panel -->
                    <StackPanel x:Name="spDataControls" 
                            Width="638" Height="440" 
                            Orientation="Horizontal">

                        <StackPanel x:Name="spDataGrid" Orientation="Vertical" Height="410" Width="311">
                            <!-- filterbox stack panel -->
                            <StackPanel x:Name="spFilterBox" Height="30" Width="311" Orientation="Horizontal" Margin="0,0,0,10">
                                <!-- change textblock to match filter descriptor -->
                                <!-- **************************** -->
                                <TextBlock Text=" Filter appName  " Height="28" Width="125" FontSize="12" />
                                <input:AutoCompleteBox x:Name="tableFilterBox" Width="180" Height="28" ValueMemberBinding="{Binding Name}" Margin="0,1" />
                                <!-- end filterbox stack panel -->
                            </StackPanel>




                            <dataControls:DataGrid x:Name="_dataGrid" Height="335" Width="310" AutoGenerateColumns="False" 
                                       ItemsSource="{Binding Data, ElementName=dds}" VerticalScrollBarVisibility="Auto" 
                                       AlternatingRowBackground="Beige" Margin="0" SelectionChanged="_dataGrid_SelectionChanged">

                                <!-- Load datagrid columns here, recommend Karl Shifflett Xaml toys -->
                                <!-- **************************** -->


                                <dataControls:DataGrid.Columns>
                                    <dataControls:DataGridTextColumn Header=" Key" Binding="{Binding appKey}" SortMemberPath="appKey" />

                                    <dataControls:DataGridTextColumn Header=" O S Key" Binding="{Binding appOSKey}" SortMemberPath="appOSKey" />

                                    <dataControls:DataGridTextColumn Header=" Name" Binding="{Binding appName}" SortMemberPath="appName" />

                                    <dataControls:DataGridTextColumn Header=" Vendor" Binding="{Binding appVendor}" SortMemberPath="appVendor" />

                                    <dataControls:DataGridTextColumn Header=" Version" Binding="{Binding appVersion}" SortMemberPath="appVersion" />

                                    <dataControls:DataGridTextColumn Header=" Service Pack" Binding="{Binding appServicePack}" SortMemberPath="appServicePack" />

                                    <dataControls:DataGridTextColumn Header=" Fix Level" Binding="{Binding appFixLevel}" SortMemberPath="appFixLevel" />

                                    <dataControls:DataGridTextColumn Header=" User Community" Binding="{Binding appUserCommunity}" SortMemberPath="appUserCommunity" />

                                    <dataControls:DataGridTextColumn Header=" Owner" Binding="{Binding appOwner}" SortMemberPath="appOwner" />

                                    <dataControls:DataGridCheckBoxColumn Header=" Move" Binding="{Binding appMove}" SortMemberPath="appMove" />
                                    <dataControls:DataGridCheckBoxColumn Header=" Owner Signoff" Binding="{Binding appOwnerSignoff}" SortMemberPath="appOwnerSignoff" />
                                    <dataControls:DataGridTextColumn Header=" Owner Signoff Date" Binding="{Binding appOwnerSignoffDate}" SortMemberPath="appOwnerSignoffDate" />

                                    <dataControls:DataGridTextColumn Header=" System Or User" Binding="{Binding appSystemOrUser}" SortMemberPath="appSystemOrUser" />

                                    <dataControls:DataGridTextColumn Header=" Availability Target" Binding="{Binding appAvailabilityTarget}" SortMemberPath="appAvailabilityTarget" />

                                    <dataControls:DataGridTextColumn Header=" Operational Impact" Binding="{Binding appOperationalImpact}" SortMemberPath="appOperationalImpact" />

                                    <dataControls:DataGridTextColumn Header=" Hours Of Operations" Binding="{Binding appHoursOfOperations}" SortMemberPath="appHoursOfOperations" />

                                    <dataControls:DataGridCheckBoxColumn Header=" Peered" Binding="{Binding appPeered}" SortMemberPath="appPeered" />
                                    <dataControls:DataGridTextColumn Header=" Int Ext" Binding="{Binding appIntExt}" SortMemberPath="appIntExt" />

                                    <dataControls:DataGridTextColumn Header=" Shape" Binding="{Binding appShape}" SortMemberPath="appShape" />

                                    <dataControls:DataGridTextColumn Header=" Network Protocol" Binding="{Binding appNetworkProtocol}" SortMemberPath="appNetworkProtocol" />

                                    <dataControls:DataGridTextColumn Header=" Hard Code I P Addresses" Binding="{Binding appHardCodeIPAddresses}" SortMemberPath="appHardCodeIPAddresses" />

                                    <dataControls:DataGridTextColumn Header=" I P Ports" Binding="{Binding appIPPorts}" SortMemberPath="appIPPorts" />

                                    <dataControls:DataGridTextColumn Header=" Hard Code Mac" Binding="{Binding appHardCodeMac}" SortMemberPath="appHardCodeMac" />

                                    <dataControls:DataGridTextColumn Header=" Comments" Binding="{Binding appComments}" SortMemberPath="appComments" />

                                    <dataControls:DataGridTextColumn Header=" Last Edit" Binding="{Binding appLastEdit}" SortMemberPath="appLastEdit" />

                                    <dataControls:DataGridTextColumn Header=" Last Update" Binding="{Binding appLastUpdate}" SortMemberPath="appLastUpdate" />

                                </dataControls:DataGrid.Columns>





                                <!-- **************************** -->
                                <!-- End of datagrid column specifications -->
                            </dataControls:DataGrid>
                            <dataControls:DataPager Source="{Binding Data, ElementName=dds}" PageSize="10" />

                            <!-- end datagrid stack panel-->
                        </StackPanel>

                        <StackPanel x:Name="spDataForm" Height="410" Width="319">
                            <!-- Change Data Header Name here -->
                            <!-- **************************** -->
                            <TextBlock Text="Application Details" Height="28" FontSize="12" FontWeight="Normal" />

                            <dataFormToolkit:DataForm x:Name="_dataForm" Height="371" Width="319" VerticalAlignment="Top" 
                               CommandButtonsVisibility="Commit,Cancel,Edit" AutoEdit="False" AutoCommit="False" CommitButtonContent="Commit" 
                               CancelButtonContent="Cancel" CurrentItem="{Binding SelectedItem, ElementName=_dataGrid}" 
                               HorizontalAlignment="Left" Margin="0,0,0,0" AutoGenerateFields="False">
                                <!-- Load dataform columns and templates here -->
                                <!-- **************************** -->


                                <dataFormToolkit:DataForm.EditTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition />
                                            </Grid.ColumnDefinitions>

                                            <dataFormToolkit:DataField Grid.Row="0" Grid.Column="0" Description="Application record Id" DescriptionViewerPosition="Auto" Label=" Key" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appKey, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="1" Grid.Column="0" Description="Operating system key" DescriptionViewerPosition="Auto" Label=" O S Key" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appOSKey, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="2" Grid.Column="0" Label=" Name" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appName, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="3" Grid.Column="0" Label=" Vendor" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appVendor, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="4" Grid.Column="0" Label=" Version" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appVersion, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="5" Grid.Column="0" Label=" Service Pack" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appServicePack, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="6" Grid.Column="0" Label=" Fix Level" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appFixLevel, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="7" Grid.Column="0" Label=" User Community" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appUserCommunity, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="8" Grid.Column="0" Label=" Owner" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appOwner, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="9" Grid.Column="0" Description="part of move plan" DescriptionViewerPosition="Auto" Label=" Move" LabelPosition="Auto">
                                                <CheckBox Content="" IsChecked="{Binding Path=appMove, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="10" Grid.Column="0" Description="Owner has signed off as ready for move" DescriptionViewerPosition="Auto" Label=" Owner Signoff" LabelPosition="Auto">
                                                <CheckBox Content="" IsChecked="{Binding Path=appOwnerSignoff, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="11" Grid.Column="0" Label=" Owner Signoff Date" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appOwnerSignoffDate, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, StringFormat=\{0:d\}}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="12" Grid.Column="0" Label=" System Or User" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appSystemOrUser, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="13" Grid.Column="0" Label=" Availability Target" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appAvailabilityTarget, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="14" Grid.Column="0" Label=" Operational Impact" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appOperationalImpact, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="15" Grid.Column="0" Label=" Hours Of Operations" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appHoursOfOperations, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="16" Grid.Column="0" Label=" Peered" LabelPosition="Auto">
                                                <CheckBox Content="" IsChecked="{Binding Path=appPeered, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="17" Grid.Column="0" Description="Internal user or seen external to organization" DescriptionViewerPosition="Auto" Label=" Int Ext" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appIntExt, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="18" Grid.Column="0" Description="Visio shape used for reports" DescriptionViewerPosition="Auto" Label=" Shape" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appShape, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="19" Grid.Column="0" Label=" Network Protocol" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appNetworkProtocol, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="20" Grid.Column="0" Label=" Hard Code I P Addresses" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appHardCodeIPAddresses, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="21" Grid.Column="0" Label=" I P Ports" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appIPPorts, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="22" Grid.Column="0" Label=" Hard Code Mac" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appHardCodeMac, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="23" Grid.Column="0" Label=" Comments" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appComments, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="24" Grid.Column="0" Label=" Last Edit" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appLastEdit, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                            <dataFormToolkit:DataField Grid.Row="25" Grid.Column="0" Label=" Last Update" LabelPosition="Auto">
                                                <TextBox Text="{Binding Path=appLastUpdate, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, StringFormat=\{0:d\}}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                            </dataFormToolkit:DataField>

                                        </Grid>
                                    </DataTemplate>
                                </dataFormToolkit:DataForm.EditTemplate>



                                <!-- **************************** -->
                                <!-- end of dataform columns and templates -->
                            </dataFormToolkit:DataForm>
                            <!-- end data form stack panel -->
                        </StackPanel>
                        <!-- end details stack panel -->
                    </StackPanel>
                    <StackPanel x:Name="spActionButtons" Height="30" Orientation="Horizontal" Width="268" HorizontalAlignment="Left">
                        <Button Click="btnSubmit_Click" Content="Submit" Height="28" Name="btnSubmit" Width="65" />
                        <Button Click="btnExport_Click" Content="Export" Height="28" HorizontalAlignment="Left" Margin="0" Name="btnExport" Width="65" />
                        <Button Click="btnCreate_Click" Content="Create" Height="28" Name="btnCreate" Width="65" />
                        <Button Click="btnDelete_Click" Content="Delete" Height="28" HorizontalAlignment="Left" Margin="0" Name="btnDelete" Width="65" />
                        <!-- end action buttons panel-->
                    </StackPanel>


                    <!-- End Content Stack Panel -->
                </StackPanel>

            </controlsToolkit:BusyIndicator>
            
        </ScrollViewer>

        <!-- end layout root -->
    </Grid>

</navigation:Page>

